import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { id } from 'element-plus/es/locale';

/**
 * 新建合同
 */
export function addContract(data:any) {
  return request({
    url: '/api/contract',
    method: 'post',
    data: data
  });
}
/**
 * 编辑合同
 */
export function updataContract(data:any) {
  return request({
    url: '/api/contract/' + data.id,
    method: 'put',
    data: data
  });
}
/**
 * 合同详情
 */
export function getContractDetail(data:any) {
  return request({
    url: '/api/contract/' + data.id,
    method: 'get'
  });
}
/**
 * 获取合同列表
 */
export function getContractList(data:any) {
  return request({
    url: '/api/contract' ,
    method: 'get',
	params:data
  });
}
/**
 * 删除合同
 */
export function deleteContract(data:any) {
  return request({
    url: '/api/contract' ,
    method: 'delete',
	params:data
  });
}

/**
 * 新增借阅记录
 */
export function addContractBorrow(data:any) {
  return request({
    url: '/api/contract/borrow' ,
    method: 'post',
	data:data
  });
}
/**
 * 编辑借阅记录
 */
export function updataContractBorrow(data:any) {
  return request({
    url: '/api/contract/borrow/'+data.id ,
    method: 'put',
	data:data
  });
}
/**
 * 删除借阅记录
 */
export function deleteContractBorrow(data:any) {
  return request({
    url: '/api/contract/borrow' ,
    method: 'delete',
	params:data
  });
}
/**
 * 借阅记录
 */
export function getContractBorrowList(data:any) {
  return request({
    url: '/api/contract/borrow' ,
    method: 'get',
	params:data
  });
}
/**
 * 借阅记录详情
 */
export function getContractBorrowDetail(data:any) {
  return request({
    url: '/api/contract/borrow/'+data.id ,
    method: 'get'
  });
}
/**
 * 员工筛选
 */
export function getUserOptions(data:any) {
  return request({
    url: '/api/user/options' ,
    method: 'get',
	params:data
  });
}
/**
 * 合同签批 - 签批列表
 */
export function getContractHuiqianList(data:any) {
  return request({
    url: '/api/contract/huiqian' ,
    method: 'get',
	params:data
  });
}
/**
 * 合同签批 -审核
 */
export function pushContractHuiqian(data:any) {
  return request({
    url: '/api/contract/huiqian/'+ data.id ,
    method: 'post',
	data:data
  });
}
/**
 * 合同审核 -列表
 */
export function getContractShenpiList(data:any) {
  return request({
    url: '/api/contract/shenpi',
    method: 'get',
	params:data
  });
}
/**
 * 合同审核 - 审核
 */
export function pushContractShenpi(data:any) {
  return request({
    url: '/api/contract/shenpi/'+ data.id ,
    method: 'post',
	data:data
  });
}